package com.ctp.ui.table;

import javax.swing.JScrollPane;

import com.ctp.thread.factory.ThreadFactory;
import com.ctp.ui.table.util.TableColumnBean;
import com.ctp.ui.table.util.TableRendererLib;

public class FormTable extends AbstractTableUI {

	private static final long serialVersionUID = 1L;

	public FormTable() {
		this.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
		table.setRowHeight(22);
	}

	protected void initTableData() {
		ThreadFactory.startTraderThread(tableModel);
	}

	protected TableColumnBean[] getTableColumn() {
		return COLUMN_LIST;
	}

	private static final TableColumnBean[] COLUMN_LIST = {
			new TableColumnBean("序号", TableRendererLib.STRING_RENDERER),
			new TableColumnBean("报单号", TableRendererLib.STRING_RENDERER),
			new TableColumnBean("合约名", TableRendererLib.STRING_RENDERER),
			new TableColumnBean("方向", TableRendererLib.STRING_RENDERER),
			new TableColumnBean("开平", TableRendererLib.STRING_RENDERER),
			new TableColumnBean("报单价格", TableRendererLib.INT_RENDERER),
			new TableColumnBean("报单数量", TableRendererLib.INT_RENDERER),
			new TableColumnBean("已成数量", TableRendererLib.INT_RENDERER),
			new TableColumnBean("成交均价", TableRendererLib.DEC_RENDERER),
			new TableColumnBean("报单时间", TableRendererLib.STRING_RENDERER),
			new TableColumnBean("状态", TableRendererLib.TOOLTIP_RENDERER),
			new TableColumnBean("操作", TableRendererLib.CLOSE_BUTTON_RENDERER) };

}
